<h2><?php echo $this->translate('TITLE_ADMIN_GROUPS_INDEX');?></h2>
<form name="appForm" method="post" action="">
<p style="padding-top: 5px; padding-bottom: 10px;">
	<a class="formbutton" href="<?php echo $this->url(array('controller'=>'groups', 'action'=>'insert'));?>"><?php echo $this->translate('TITLE_ADMIN_GROUPS_ADD_NEW'); ?></a>
	<a class="formbutton" href="#" onclick="OnSubmitForm('<?php echo $this->url(array('controller'=>'groups', 'action'=>'deleteitems'));?>')"><?php echo $this->translate('TITLE_ADMIN_GROUPS_DEL_ITEMS'); ?></a>
</p>

<table class="downtable">
	<thead>
		<thead>
			<tr>
				<th class="firstcol" width="5%"><input type="checkbox" name="checkbox" id="checkbox" onclick="checkedAll()"></th>
			    <th class="middle" width="30%"><?php echo $this->translate('TITLE_TABLE_GROUPS_NAME');?></th>
			    <th class="middle" width="10%"><?php echo $this->translate('TITLE_TABLE_GROUPS_STATUS');?></th>
			    <th class="middle" width="15%"><?php echo $this->translate('TITLE_TABLE_GROUPS_CONTROL');?></th>
			    <th class="thlast" width="5%"><?php echo $this->translate('TITLE_TABLE_GROUPS_ID');?></th>
			</tr>
		</thead>
		
	</thead>
	<tbody>
		<?php 
		foreach($this->paginator as $items){
			echo '<tr>';
			echo '<td class="firsttd"><input type="checkbox" name="cid[]" id="cid" value="'.$items['id'].'"></td>';
			echo '<td class="middle">'.$items['name'].'</td>';
			if($items['active']){
				echo '<td class="middle"><a href="'.$this->url(array('controller'=>'groups', 'action'=>'active', 'id'=>$items['id'],'type'=>0,'page'=>$this->page)).'"><div class="active"></div></a></td>';
			}else{
				echo '<td class="middle"><a href="'.$this->url(array('controller'=>'groups', 'action'=>'active', 'id'=>$items['id'],'type'=>1,'page'=>$this->page)).'"><div class="inactive"></div></a></td>';
			}
			echo '<td class="last"><a href="'.$this->url(array('controller'=>'groups', 'action'=>'update', 'id'=>$items['id'], 'page'=>$this->page)).'"><div class="edit"></div></a><a href="'.$this->url(array('controller'=>'groups', 'action'=>'permissions', 'id'=>$items['id'], 'page'=>$this->page)).'"><div class="permissions"></div></a><a href="'.$this->url(array('controller'=>'groups', 'action'=>'delete', 'id'=>$items['id'], 'page'=>$this->page)).'"><div class="del"></div></a></td>';
			echo '<td class="last">'.$items['id'].'</td>';
			echo '</tr>';
		}
		?>
		<tr>
			<td colspan="7" class="firsttd">
			    <?php echo $this->paginationControl($this->paginator, 'Sliding', 'pagination.phtml');?>
			</td>
		</tr>
	</tbody>
</table>

<p style="padding-top: 20px;">
	<a class="formbutton" href="<?php echo $this->url(array('controller'=>'groups', 'action'=>'insert'));?>"><?php echo $this->translate('TITLE_ADMIN_GROUPS_ADD_NEW'); ?></a>
	<a class="formbutton" href="#" onclick="OnSubmitForm('<?php echo $this->url(array('controller'=>'groups', 'action'=>'deleteitems'));?>')"><?php echo $this->translate('TITLE_ADMIN_GROUPS_DEL_ITEMS'); ?></a>
</p>

</form>